#include "widget.h"
#include "ui_widget.h"
#include <QIcon>
#include <QPushButton>
Widget::Widget(QWidget *parent)
    : QWidget(parent)
    , ui(new Ui::Widget)
{
    ui->setupUi(this);
//    QIcon icon("D:/study_qt/qwidget_windowIcon/1.jpg");
//    this->setWindowIcon(icon);
//    QPushButton* button = new QPushButton(this);
//    connect(button,&QPushButton::clicked,this,&Widget::handle);

    this->setWindowTitle("设置图标");
    QIcon icon(":/icon.jpg");
    this->setWindowIcon(icon);
}

Widget::~Widget()
{
    delete ui;
}

//void Widget::handle()
//{
//    //设置图标
//    QIcon icon("D:/study_qt/qwidget_windowIcon/1.jpg");
//    this->setWindowIcon(icon);
//}

